<script>
	export default {
		onLaunch: function() {
			const updateManager = wx.getUpdateManager();
			
			updateManager.onCheckForUpdate(function(res) {
				// 请求完新版本信息的回调
			});
			
			updateManager.onUpdateReady(function() {
				wx.showModal({
					title: '更新提示',
					content: '新版本已经准备好，是否重启应用？',
					success: function(res) {
						if (res.confirm) {
							// 新的版本已经下载好，调用 applyUpdate 应用新版本并重启
							updateManager.applyUpdate();
						}
					}
				});
			});
			
			updateManager.onUpdateFailed(function() {
				return that.Tips({
					title: '新版本下载失败'
				});
			});
		},
		onShow: function() {
		},
		onHide: function() {
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "uview-ui/index.scss";
	@import '@/common/css/common.scss';
	//暂无数据
	.nodata{
		text-align: center;
		font-size: 32rpx;
		color:#aaa;
		position: absolute;
		left: 0;
		top:50%;
		transform: translateY(-50%);
		width: 100%;
	}
	.cell-box {
		background-color: #fff;
		margin-top: 20rpx;
		border-radius: 10rpx;
		padding: 0 20rpx;
		.cell-item {
			padding: 26rpx 0rpx;
			border-bottom: 1rpx solid #eee;
	
			&:last-child {
				border-bottom: 0;
			}
		}
	}
	.line-title {
		margin: 30rpx 0 20rpx;
		font-weight: bold;
		position: relative;
		padding-left: 18rpx;
		&:before {
			content: '';
			position: absolute;
			width: 8rpx;
			height: 20rpx;
			background: #3399FF;
			border-radius: 2rpx;
			top: 50%;
			left: 0;
			transform: translateY(-50%);
		}
	}
	.line-height-40{
		line-height: 40rpx;
	}
	.line-height-50{
		line-height: 50rpx;
	}
	//弹出层标题
	.popup-title{
		text-align: center;
		height: 90rpx;
		line-height: 90rpx;
		font-size: 32rpx;
		font-weight: bold;
		color: #333;
	}
	
	.public-status-bar {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		z-index: 9999;
		height: var(--status-bar-height);
	}
	
	//底部按钮
	.footer-btn{
		background: #fff;
		padding: 10rpx 30rpx;
		padding-bottom: calc(10rpx + constant(safe-area-inset-bottom));///兼容 IOS<11.2/
		padding-bottom: calc(10rpx + env(safe-area-inset-bottom));///兼容 IOS>11.2/
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		border-top: 1rpx solid #F8F9FA;
		z-index: 1996;
	}
	
	.flex-aj-center{
		display:flex;
		align-items:center;
		justify-content:center;
	}
	
	.flex{
		display:flex;
	}
	
	.flex-1{
		flex:1
	}
	
	.flex-align-center{
		display:center;
		align-items:center;
	}
	
</style>
